//
//  WCPatientInforCell.m
//  WC
//
//  Created by wsj2015 on 16/1/24.
//  Copyright © 2016年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCPatientInforCell.h"
#import "NSString+Utilities.h"
#import "WCTSetTextTool.h"

@implementation WCPatientInforCell
{
    NSArray *_typeArray;
}



- (void)awakeFromNib {
    // Initialization code
//    self.iocnView.layer.cornerRadius = 25;
//    self.iocnView.layer.masksToBounds = YES;
//    1伤口，2PICC，3妇幼，4慢性，5其他(
    _typeArray =@[@"伤口",@"PICC",@"妇幼",@"慢性",@"其他"];
    
    
}
- (void)setModel:(WCPatientInforList *)model{
    //addDate = 1453804013681;
    //age = 23;
    //name = Dddd;
    //recordId = 5;
    //recordType = 0;
    
//    @property (weak, nonatomic) IBOutlet UIImageView *iocnView;
//    @property (weak, nonatomic) IBOutlet UILabel *nameLabel;
//    @property (weak, nonatomic) IBOutlet UILabel *ageLabel;
//    @property (weak, nonatomic) IBOutlet UILabel *typeLabel;
//    @property (weak, nonatomic) IBOutlet UILabel *timeLabel;
    _model = model;
    self.nameLabel.text = [model.name stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    WSJSetTxt(self.ageLabel, model.age, @"年龄:(未知)");
//     WSJSetTxt(self.ageLabel, ], @"");
   
    self.timeLabel.text =[NSString stringWithFormat:@"更新于%@",[NSString timeToString:[model.addDate longLongValue]]];
    NSString *imageName;
    NSInteger index= [model.recordType integerValue]-1;
    
    if (index>=0 &&index <=6) {
        NSLog(@"------%i",index);
        imageName =[NSString stringWithFormat:@"%@_随访",_typeArray[index]];
        self.typeLabel.text =[NSString stringWithFormat:@"%@患者",_typeArray[index]];
    }
  
    
    self.iocnView.image=[UIImage imageNamed:imageName];

}

- (IBAction)motifyAction:(id)sender {
    if (self.motifyBlock) {
        self.motifyBlock();
    }
}

- (IBAction)updateAction:(id)sender {
    if (self.updateBlock) {
        self.updateBlock();
    }
}

@end
